package com.zl.learning.json.fastjson;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Data
@NoArgsConstructor
public class User {
    private Long id;
    private String name;
    private String passwd;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    private List<ClassRoom> classRoomList;

    public User(Long id, String name, LocalDateTime createTime) {
        this.id = id;
        this.name = name;
        this.createTime = createTime;
    }

    public User(Long id, String name, String passwd, LocalDateTime createTime, List<ClassRoom> classRoomList) {
        this.id = id;
        this.name = name;
        this.passwd = passwd;
        this.createTime = createTime;
        this.classRoomList = classRoomList;
    }
}
